package com.cgt.xiaotao.order.domain.po;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.cgt.xiaotao.model.model.base.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.math.BigDecimal;

@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(description = "订单商品表")
@TableName("order_item")
public class OrderItem extends BaseEntity {

    @ApiModelProperty(value = "订单商品ID")
    @TableId(type = IdType.AUTO)
    @TableField("id")
    private Long id;

    @ApiModelProperty(value = "订单ID")
    @TableField("order_id")
    private Long orderId;

    @ApiModelProperty(value = "商品ID")
    @TableField("product_id")
    private Long productId;

    @ApiModelProperty(value = "商品名称")
    @TableField("product_name")
    private String productName;

    @ApiModelProperty(value = "商品图片")
    @TableField("product_image")
    private String productImage;

    @ApiModelProperty(value = "购买单价")
    @TableField("price")
    private BigDecimal price;

    @ApiModelProperty(value = "购买数量")
    @TableField("quantity")
    private Integer quantity;
}